<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/taglibs.jsp"%>

<form action="${ctx}/sys/userrole/update" method="post">
    <table>
        <tbody>
            <tr>
                <td><label for="updateform-id">访问控制ID</label></td>
                <td><input type="text" id="updateform-id" name="id" value="${userrole.id}" readonly="readonly" class="easyui-textbox"
                        data-options="validType:'length[0,32]', prompt:'不输入时会自动生成'"/>
                </td>
            </tr>
            <tr>
                <td><label for="updateform-userId">用户</label></td>
                <td><input type="text" id="updateform-userId" name="userId" value="${userrole.userId}" class="easyui-textbox"
                        data-options="required:true, validType:'length[0,32]'"/>
                </td>
            </tr>
            <tr>
                <td><label for="updateform-roleId">角色</label></td>
                <td><input type="text" id="updateform-roleId" name="roleId" value="${userrole.roleId}" class="easyui-textbox"
                        data-options="required:true, validType:'length[0,32]'"/>
                </td>
            </tr>
        </tbody>
    </table>
</form>

<script type="text/javascript">
$(function() {
    var $userId = $('#updateform-userId');
    $userId.combogrid({
        url: ctx + '/sys/user/users-like-loginAct',
        mode: 'remote',
        idField: 'id',
        textField: 'loginAct',
        fitColumns: true,
        rownumbers: true,
        panelWidth: 300,
        columns: [[
            {title: '用户ID', field: 'id', sortable: true, width: 100},
            {title: '登录名', field: 'loginAct', sortable: true, width: 100},
            {title: '人员名', field: 'name', sortable: true, width: 100},
        ]]
    });
    
    var $roleId = $('#updateform-roleId');
    $roleId.combogrid({
        url: ctx + '/sys/role/roles-like-name',
        mode: 'remote',
        idField: 'id',
        textField: 'name',
        fitColumns: true,
        rownumbers: true,
        panelWidth: 300,
        columns: [[
            {title: '角色ID', field: 'id', sortable: true, width: 100},
            {title: '角色名', field: 'name', sortable: true, width: 100}
        ]]
    });
});
</script>